﻿using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.IO;

namespace OpenLS.Spreadsheet.Formats.Biff.Records
{
    internal class FtEdoData
    {
        private ushort _fMultiLine;
        private ushort _fVScroll;
        private ushort _id;
        private ushort _ivtEdit;

        public void Read(BinaryReader reader)
        {
            ushort ft = reader.ReadUInt16();
            Contract.Assert(ft == 0x0010);
            ushort cb = reader.ReadUInt16();
            Contract.Assert(cb == 0x0008);
            _ivtEdit = reader.ReadUInt16();
            _fMultiLine = reader.ReadUInt16();
            _fVScroll = reader.ReadUInt16();
            _id = reader.ReadUInt16();
        }

        public void Write(BinaryWriter writer)
        {
            const ushort ft = 0x0010;
            writer.Write(ft);
            const ushort cb = 0x0008;
            writer.Write(cb);
            writer.Write(_ivtEdit);
            writer.Write(_fMultiLine);
            writer.Write(_fVScroll);
            writer.Write(_id);
        }
    }
}